Various standards have emerged for the transport of digital data, such as, for example, digital television data. One example of such a standard is the Motion Picture Experts Group (MPEG) standard, referred to as MPEG-2. The MPEG-2 standard is widely known and recognized as the video and audio compression specification sanctioned by the International Standards Organization (ISO) in Document ISO 13818. MPEG-2 is composed of four parts: video; audio; systems; and compliance. The MPEG-2 standard provides a syntax and set of rules for the construction of bit streams containing a multiplexed combination of one or more programs. A program is composed of one or more related elementary streams. An elementary stream is the coded representation of a single video, audio or other data stream that shares the common time base of the program for which it is a member. For example, in the context of a subscription television system, a program may comprise a network television broadcast consisting of two elementary streams: a video stream and an audio stream.
In addition to video and audio compression features, the MPEG-2 specification also contains a systems layer that provides a transmission medium independent coding technique to build bitstreams containing one or more MPEG programs. The MPEG coding technique uses formal grammar (i.e., "syntax") and a set of semantic rules for the construction of bitstreams to be transmitted. The syntax and semantic rules include provisions for multiplexing, clock recovery, synchronization and error resiliency.
The MPEG-2 transport stream is specifically designed for transmission in conditions that can generate data errors. MPEG transport packets each have a fixed length of 188 bytes. Many programs, each with different components, may be combined in a transport stream. Examples of services that may be provided using MPEG format are television services broadcast over terrestrial, cable television and satellite networks, as well as interactive telephony-based services. The syntax and semantics of the MPEG-2 transport stream are defined in the International Organisation for Standardisation, ISO/IEC 13818-1, International Standard, Nov. 13, 1994, entitled "Generic Coding of Moving Pictures and Associated Audio: Systems", recommendation H.222.0, and ISO/IEC 13818-2, International Standard, 1995, entitled, "Generic Coding of Moving Pictures and Associated Audio: Video", recommendation H262, both incorporated herein by reference, in their entireties.
Multiplexing according to the MPEG-2 standard is accomplished by packaging raw elementary data streams such as coded video and audio into packetized elementary stream (PES) packets which are then inserted into transport packets. As noted above, each MPEG-2 transport packet has a fixed length of 188 bytes. The first byte is a synchronization byte having a unique eight-bit pattern. The synchronization byte is used to locate the beginning of each transport packet.
Following the synchronization byte, there is a three byte prefix that includes a one bit transport packet error indicator, a one bit payload unit start indicator, a one bit transport priority indicator, a 13 bit packet identifier (PID), a two bit transport scrambling control, a two bit adaptation field control, and a four bit continuity counter. Use of the synchronization byte and the three byte prefix leaves up to 184 bytes of payload which carry the data to be communicated. An optional adaptation field may follow the prefix for carrying both MPEG related and private information relevant to a given transport stream or the elementary stream carried within a given transport packet. Provisions for clock recovery, such as, for example, a program clock reference (PCR) and splicing control are typical of the information carried in the adaptation field. By placing such information in the adaptation field, it becomes encapsulated with its associated data to facilitate remultiplexing and network routing operations. When an adaptation field is used, the payload is correspondingly shorter.
The PCR is a count which reflects the value of the system time clock for the associated program at the time the PCR bytes were inserted into the transport stream. The decoder uses the PCR to synchronize a decoder time clock with the encoder system clock. The lower nine bits of the 42-bit PCR provide a modulo-300 counter that is incremented at the system clock rate. Since each program or service carried by the data stream may have its own PCR, the programs and services may be multiplexed asynchronously.
As defined in the MPEG-2 systems standard, an elementary stream, whether video, audio or some other type of data, contains a continuous stream of access units. An access unit is the coded representation of a presentation unit. For video elementary streams, the presentation unit is a picture, and an access unit for that picture includes all the coded, e.g., compressed, data for that picture. The presentation unit for audio elementary streams is defined as the set of digital audio samples in a single audio frame. An access unit for a given audio frame will include all the coded, e.g., compressed, data for that audio frame.
Each elementary stream, as further defined by the MPEG-2 standard, is packetized to form a packetized elementary stream (PES). Each PES packet in a given stream includes a PES packet header followed by a payload containing one or more access units of that elementary stream. The PES structure provides a means for packaging subparts, i.e., one or more access units, of a longer elementary stream into consecutive packets along with associated indicators and overhead information used to synchronize the presentation of that elementary stream with other related elementary streams, e.g., elementary streams of the same program. Each PES is assigned a unique packet identifier (PID).
Additionally, one or more PES may be further segmented or packetized to facilitate combining those streams into a single bitstream for transmission over a given medium. MPEG-2 specifies two different protocols for combining one or more PESs into a single bitstream: (1) the program stream (PS) protocol; and (2) the transport stream protocol. Both stream protocols are packet based and fall into the category of transport layer entities, as defined by the ISO Open Systems Interconnection (OSI) reference model. Program streams utilize variable length packets and are intended for error-free environments in which software parsing is desired. Program stream packets are generally large, e.g., in the range of 1K to 2K bytes. Transport streams utilize fixed length packets and are intended for transmission in noisy or "errored" environments. Each transport stream packet comprises a header portion and a payload portion. As described above, transport stream packets have a relatively short length of 188 bytes and include features for enhanced error resiliency and packet loss detection.
The MPEG-2 transport stream specification provides a standard format for combining one or more PESs into a single transport stream that may then be transmitted over a given medium. FIG. 1 graphically illustrates the generation of an MPEG-2 transport stream from a plurality of PESs. Generation of an MPEG-2 transport stream begins by segmenting each PES and inserting successive segments into the payload sections of successive transport stream packets. For example, as illustrated in FIG. 1, one of the PES packets 10 of the PES containing the coded video of elementary stream "Video 1", is segmented and inserted into the payload sections of two consecutive transport packets 12, 14. Every transport packet has a header, for example, header 16 of transport packet 12, and the header of each transport packet contains the PID associated with the PES carried in that transport packet. In the example illustrated in FIG. 1, the PES carrying the coded video of elementary stream "Video 1" has been assigned a PID of `10`, and therefore, the header of each transport packet 12, 14 carrying the data of that PES will contain a PID value of `10`. Similarly, the headers of each transport packet 18, 20 carrying the PES data for elementary stream "Audio 1" will contain the PID assigned to that elementary stream, which in the example shown is `23` . As each PES is segmented and inserted into respective transport packets, those packets are fed to a transport stream multiplexer 22 that multiplexes the packet to form a single bit stream, referred to as a "Transport Stream". Thus, a transport stream comprises a continuous sequence of transport packets, each of which may carry data from one of a plurality of PESs. At a decoder location, a given PES can be recovered from the incoming transport stream by simply extracting every incoming packet whose header contains the PID assigned to that PES.
Generation of transport packets is carried out by an encoder employing a common system clock. Decoders for receiving and presenting a selected program must have a system clock whose frequency of operation and absolute instantaneous value match those of the encoder. However, in practice, a decoder's free running system clock frequency will not match the encoder's system clock frequency exactly. Therefore, some method for synchronizing the decoder system clock with the encoder system clock is required. In the MPEG-2 systems standard, synchronization of the encoder's and decoder's system clocks is achieved using time stamps called Program Clock References (PCRs). A PCR is typically an actual sample of the encoder's system clock. For each program carried in a given transport stream, PCRs must be generated at least once every 100 ms and inserted into the transport packets carrying one of the elementary streams that make up that program. For programs comprised of a video elementary stream and an audio elementary stream, PCRs are typically generated and inserted into the transport packets that carry the PES data for the video elementary stream. In the example shown in FIG. 1, one PCR 24 was generated during the creation of transport packet 12 and another PCR was generated during the creation of transport packet 14, each of which carry PES data for the video elementary stream "Video 1". Similarly, a PCR 28 was generated during the creation of transport packet 32 which carries PES data for the video elementary stream "Video 21". Each PCR, as set forth above, is an actual sample of the encoder system clock at the time the PCR was generated and inserted into its respective transport packet.
At the reception site, a decoder can use the transmitted PCRs to "slave" its system clock to the encoder's system clock. Decoders allow recipients of a transport stream to select one of the programs carried in the transport stream for output or presentation at the reception site. For example, in a subscription television system, wherein each program may represent a different television broadcast, a subscriber may employ a decoder to select one of those programs for viewing on a television set. A television program will typically comprise a video elementary stream and an audio elementary stream.
In certain prior art systems, plural multiplexers are used in conjunction with the encoding equipment, thereby providing a redundant system that provides improved fault tolerance and system reliability. In the case of a system that employs redundant multiplexers, it is important to synchronize the various equipment to a requisite reference. In one prior art example shown in U.S. Pat. No. 5,502,499, entitled "Synchronizing Waveform Generator", to Birch et al., and assigned to Scientific-Atlanta, Inc., the assignee of the instant invention, the disclosure of which is incorporated by herein by reference in its entirety, the arrangement involving plural multiplexers or other digital or analog data equipment is synchronized using a continuous wave signal for locking all of the equipment to a common reference. This situation is analogous to the common practice in telecommunication systems of providing a continuous "pilot" signal at various frequencies for regulation, alarms and/or protection switching control in steps of a multiplex above a channel bank level.
As will be appreciated, it is extremely important to insert accurate PCR data into MPEG-2 packets so that proper synchronization of programs that are encoded on different encoders and which may be transmitted using different redundant multiplexers or decoded by different decoders may be accurately delivered to the end user. For example, related audio and video signals for a given program may be encoded on different encoders, transmitted by different multiplexers and decoded by different decoders. If the PCR is not accurately provided to each of the devices, synchronization of the audio and video portions of a program may be compromised, thereby causing the received program to be unintelligible. Accordingly, what is needed is a method and apparatus for accurately providing PCR data to various equipment in a robust manner, especially in the case of a system that includes redundant equipment arrangements, in which case it is not necessarily known what equipment will be transmitting at any given moment in time.